// 要在在全局导入
// import minxin from "common/mixin";
// Vue.use(minxin);
import { debounce } from "common/utils";

export default {
  install(Vue) {
    Vue.mixin({
      data() {
        return {
          start: "Hello Mixin",
          itemImageListener: null,
        };
      },
      methods: {
        add(num, num2) {
          return num + num2;
        },
        getImgLoading(callback) {
          const refresh = debounce(this.$refs.scroll.refresh, 50);
          this.itemImageListener = () => {
            refresh();
          };
          this.$bus.$on("imgItemLoadind", this.itemImageListener);
          setTimeout(() => {
            callback && callback();
          }, 500);
        },
        // 调用方法
        // console.log(this.add(1, 2));
      },
      mounted() {},
    });
  },
};
